home *** CD-ROM | disk | FTP | other *** search
/ Aminet 37 / Aminet 37 (2000)(Schatztruhe)[!][Jun 2000].iso / Aminet / dev / lang / sofa.lha / sofa / smalleiffel / lib_se / e_retry.e < prev    next >
Text File  |  2000-03-25  |  3KB  |  99 lines

  1. --          This file is part of SmallEiffel The GNU Eiffel Compiler.
  2. --          Copyright (C) 1994-98 LORIA - UHP - CRIN - INRIA - FRANCE
  3. --            Dominique COLNET and Suzanne COLLIN - colnet@loria.fr
  4. --                       http://SmallEiffel.loria.fr
  5. -- SmallEiffel is  free  software;  you can  redistribute it and/or modify it
  6. -- under the terms of the GNU General Public License as published by the Free
  7. -- Software  Foundation;  either  version  2, or (at your option)  any  later
  8. -- version. SmallEiffel is distributed in the hope that it will be useful,but
  9. -- WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  10. -- or  FITNESS FOR A PARTICULAR PURPOSE.   See the GNU General Public License
  11. -- for  more  details.  You  should  have  received a copy of the GNU General
  12. -- Public  License  along  with  SmallEiffel;  see the file COPYING.  If not,
  13. -- write to the  Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  14. -- Boston, MA 02111-1307, USA.
  15. --
  16. class E_RETRY
  17.    --
  18.    -- To store instruction "retry" for exception handling.
  19.    --
  20.  
  21. inherit INSTRUCTION;
  22.  
  23. creation make
  24.  
  25. feature
  26.  
  27.    start_position: POSITION;
  28.  
  29.    end_mark_comment: BOOLEAN is false;
  30.  
  31.    is_pre_computable: BOOLEAN is false;
  32.  
  33.    use_current: BOOLEAN is false;
  34.  
  35.    afd_check is
  36.       do
  37.       end;
  38.  
  39.    collect_c_tmp is
  40.       do
  41.       end;
  42.  
  43.    compile_to_c is
  44.       do
  45.          if run_control.no_check then
  46.             run_feature.c_assertion_flag;
  47.             cpp.put_string("=1;%N");
  48.          end;
  49.          cpp.put_string("goto retry_tag;%N");
  50.       end;
  51.  
  52.    compile_to_jvm is
  53.       do
  54.          eh.add_position(start_position);
  55.          fatal_error(fz_jvm_error);
  56.       end;
  57.  
  58.    to_runnable(ct: TYPE): like Current is
  59.       local
  60.          rf: RUN_FEATURE;
  61.       do
  62.          rf := small_eiffel.top_rf;
  63.          if run_feature = Void then
  64.             run_feature := rf;
  65.             Result := Current;
  66.          elseif run_feature = rf then
  67.             Result := Current
  68.          else
  69.             !!Result.make(start_position);
  70.             Result := Result.to_runnable(ct);
  71.          end;
  72.       end;
  73.  
  74.    stupid_switch(r: ARRAY[RUN_CLASS]): BOOLEAN is
  75.       do
  76.          Result := true;
  77.       end;
  78.  
  79.    pretty_print is
  80.       do
  81.          fmt.put_string("retry");
  82.          if fmt.semi_colon_flag then
  83.             fmt.put_character(';');
  84.          end;
  85.       end;
  86.  
  87. feature {NONE}
  88.  
  89.    run_feature: RUN_FEATURE;
  90.          -- Corresponding one when runnable.
  91.  
  92.    make(sp: like start_position) is
  93.       do
  94.          start_position := sp;
  95.       end;
  96.  
  97. end -- E_RETRY
  98.  
  99.